#include <bits/stdc++.h>

using namespace std;

class BigInt
{
    friend BigInt operator + (BigInt a, BigInt b);  // 高精度加法
    
    friend BigInt operator * (BigInt a, BigInt b);  // 高精度乘法
public:
    BigInt() = default;

    BigInt(int val)
    {
        if(val == 0)
        {
            v.push_back(0);
        }
        while(val > 0)
        {
            v.push_back(val % 10);
            val /= 10;
        }
        reverse();
    }

    auto begin()
    {
        return v.begin();
    }

    auto end()
    {
        return v.end();
    }

    int operator [] (int i)
    {
        return v[i];
    }

    int size()
    {
        return v.size();
    }

    void reverse()
    {
        std::reverse(v.begin(), v.end());
    }

    int back()
    {
        return v.back();
    }

    void push_back(int x)
    {
        v.push_back(x);
    }

    void pop_back()
    {
        v.pop_back();
    }

    void print()
    {
        for(const auto& i : v)
        {
            cout << i;
        }
        cout << endl;
    }

private:
    vector<int> v;
};

BigInt operator + (BigInt a, BigInt b)
{
    BigInt ans;

    int i = a.size() - 1, j = b.size() - 1;

    int tmp = 0;
    while(i >= 0 || j >= 0 || tmp > 0)
    {
        if(i >= 0) tmp += a[i--];
        if(j >= 0) tmp += b[j--];
        ans.push_back(tmp % 10);
        tmp /= 10;
    }

    ans.reverse();

    return ans;
}

BigInt operator * (BigInt a, BigInt b)
{
    BigInt ans;

    int n = a.size(), m = b.size();
    a.reverse(), b.reverse();
    
    vector<int> tmp(n + m);

    for(int i = 0; i < n; i ++)
    {
        for(int j = 0; j < m; j ++)
        {
            tmp[i + j] += a[i] * b[j];
        }
    }

    int c = 0;
    for(auto x : tmp)
    {
        c += x;
        ans.push_back(c % 10);
        c /= 10;
    }

    while(ans.size() > 1 && ans.back() == 0) ans.pop_back();

    ans.reverse();

    return ans;
}

ostream& operator << (ostream& out, BigInt b)
{
    for(const auto& i : b)
    {
        out << i;
    }
    out << endl;
}

BigInt ans(0), fac(1);  

int main()
{
    int n; cin >> n;

    for(int i = 1; i <= n; i ++)
    {
        fac = fac * i;
        ans = ans + fac;
    }

    ans.print();

    return 0;
}